package com.ymatou.paygetway.testcase;

import java.math.BigDecimal;
import java.security.PrivateKey;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.payment.parameter.AcquireOrderBean;
import com.ymatou.iapi.payment.parameter.AliPayNotifyBean;
import com.ymatou.iapi.payment.parameter.AliPayWapNotifyBean;
import com.ymatou.iapi.payment.parameter.PayOrderEnum;
import com.ymatou.iapi.payment.parameter.WeiXinNotifyBean;
import com.ymatou.paygetway.parameter.ApplePayNotifyBean;
import com.ymatou.paygetway.parameter.BaoFuNotifyBean;
import com.ymatou.paygetway.parameter.CMBNotifyBean;
import com.ymatou.paygetway.serivce.NotifyCall;
import com.ymatou.paygetway.serivce.NotifyCall50;
import com.ymatou.paygetway.serivce.NotifyCall70;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.core.tool.RSAUtils;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P2;
import com.ymt.utils.tag.P3;
import com.ymttest.business.data.Sign;
import com.ymttest.business.data.applepaysign.ApplePayConstants;
import com.ymttest.business.data.applepaysign.Hex;
import com.ymttest.business.data.applepaysign.SecurityUtil;
import com.ymttest.business.service.PayGateWayCallService;
import com.ymttest.business.service.PaymentProxyCallService;
import com.ymttest.common.enums.BankIdEnum;
import com.ymttest.database.model.Account;
import com.ymttest.database.model.AccountEntry;
import com.ymttest.database.model.MPayment;
import com.ymttest.database.model.ThirdpartyUserbind;
import com.ymttest.database.model.AccountEntry;
import com.ymttest.database.sqlwapper.AccountWapper;
import com.ymttest.database.sqlwapper.JUserWapper;
import com.ymttest.database.sqlwapper.PayGateWayWapper;
import com.ymttest.database.sqlwapper.PaymentDefaultWapper;
import com.ymttest.utils.BaofooSignature;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;

/**
 * 支付异步回调接口 FreeMaker Template自动生成代码 回调主要验证微信JSAPI APP 支付宝PC APP场景 验证签名 返回码 支付号
 * 金额 商户号 异常情况
 * 验证不同渠道PayRecharge,PostPay,Recharge,SellerMarginRecharge,SellerRecharge资金流水
 */
@TestSuite
public class Ts_Notify {
	private static WeiXinNotifyBean wxnotifyBean;
	private static AliPayNotifyBean alinotifyBean;
	private static ApplePayNotifyBean applyPayNotifyBean;
	private static NotifyCall notifyCall;
	private static NotifyCall notifyCall50;
	private static CMBNotifyBean cmbNotifyBean;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("支付异步回调接口");
	}

	@Before
	public void caseUp() {
		wxnotifyBean = new WeiXinNotifyBean();
		alinotifyBean = new AliPayNotifyBean();
		notifyCall = new NotifyCall();
		applyPayNotifyBean = new ApplePayNotifyBean();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(notifyCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_001() {
		Logger.start(true, "10支付宝PC支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, alinotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(alinotifyBean.getPrice()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(alinotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("Alipay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_002() {
		Logger.start(true, "11.支付宝WAP支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("11");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("11");
			AliPayWapNotifyBean aliwap = PayGateWayCallService.initAliPayWapNotify(aqb);
			String send = PayGateWayCallService.signAliWapNotify(aliwap);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyWapDB(aqb, aliwap);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_003() {
		Logger.start(true, "13.支付宝-APP支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_004() {
		Logger.start(true, "14.微信JSAPI支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(wxnotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_005() {
		Logger.start(true, "15.微信APP支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_006() {
		Logger.start(false, "10支付宝PC支付签名错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("AliPayNotifyBean加签并转换为SendString，设置sign错误");
			// 排序加签名
			String src = FormatUtil.beanToHttpString(alinotifyBean, false);
			String sign = SignSHA1WithRSA(src);
			alinotifyBean.setSign(sign + 1);
			alinotifyBean.setSign_type("RSA");
			// 转换成最终发出的数据
			String send = FormatUtil.beanToHttpString(alinotifyBean, true);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_007() {
		Logger.start(false, "10支付宝PC支付Out_trade_no错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("设置错误的Out_trade_no:123");
			alinotifyBean.setOut_trade_no("123");
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_008() {
		Logger.start(false, "10支付宝PC支付Out_trade_no不输入,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("设置Out_trade_no:null");
			alinotifyBean.setOut_trade_no(null);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_009() {
		Logger.start(false, "13.支付宝-APP支付签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("AliPayNotifyBean加签并转换为SendString，设置sign错误");
			// 排序加签名
			String src = FormatUtil.beanToHttpString(alinotifyBean, false);
			String sign = SignSHA1WithRSA(src);
			alinotifyBean.setSign(sign + 1);
			alinotifyBean.setSign_type("RSA");
			// 转换成最终发出的数据
			String send = FormatUtil.beanToHttpString(alinotifyBean, true);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_010() {
		Logger.start(false, "13.支付宝-APP支付Out_trade_no错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("设置错误的Out_trade_no:123");
			alinotifyBean.setOut_trade_no("123");
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_011() {
		Logger.start(false, "13.支付宝-APP支付不输入Out_trade_no,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("设置错误的Out_trade_no:null");
			alinotifyBean.setOut_trade_no(null);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_012() {
		Logger.start(false, "14.微信JSAPI支付签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			// 排序加签名
			String src = FormatUtil.beanToHttpString(wxnotifyBean, false);
			String sign = SignSHA1WithRSA(src);
			Logger.comment("设置签名错误");
			wxnotifyBean.setSign(sign + 1);
			// 转换成最终发出的数据
			String send = FormatUtil.beanToXmlString(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_013() {
		Logger.start(false, "14.微信JSAPI支付Out_trade_no错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOut_trade_no("123");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_014() {
		Logger.start(false, "14.微信JSAPI支付MerchantId错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setMch_id("123");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_015() {
		Logger.start(false, "14.微信JSAPI支付ResultCode失败,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setResult_code("FAIL");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_016() {
		Logger.start(false, "14.微信JSAPI支付ReturnCode失败,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setReturn_code("FAIL");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_017() {
		Logger.start(false, "14.微信JSAPI支付TransactionID空值,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTransaction_id(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_018() {
		Logger.start(false, "14.微信JSAPI支付TotalFee小于0,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTotal_fee("-1");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_019() {
		Logger.start(false, "14.微信JSAPI支付Out_trade_no为空,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOut_trade_no(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_020() {
		Logger.start(false, "15.微信APP支付签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			// 排序加签名
			String src = FormatUtil.beanToHttpString(wxnotifyBean, false);
			String sign = SignSHA1WithRSA(src);
			Logger.comment("设置签名错误");
			wxnotifyBean.setSign(sign + 1);
			// 转换成最终发出的数据
			String send = FormatUtil.beanToXmlString(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_021() {
		Logger.start(false, "15.微信APP支付Out_trade_no错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOut_trade_no("123");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_022() {
		Logger.start(false, "15.微信APP支付MerchantId错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setMch_id("123");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_023() {
		Logger.start(false, "15.微信APP支付ResultCode失败,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setResult_code("FAIL");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_024() {
		Logger.start(false, "15.微信APP支付ReturnCode失败,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setReturn_code("FAIL");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_025() {
		Logger.start(false, "15.微信APP支付TransactionID空值,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTransaction_id(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_026() {
		Logger.start(false, "15.微信APP支付TotalFee小于0,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTotal_fee("-1");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_027() {
		Logger.start(false, "15.微信APP支付Out_trade_no为空,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOut_trade_no(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_028() {
		Logger.start(false, "10支付宝PC支付金额错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setTotal_fee(alinotifyBean.getTotal_fee() + 1);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_029() {
		Logger.start(false, "13.支付宝-APP支付金额错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setTotal_fee(alinotifyBean.getTotal_fee() + 1);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_030() {
		Logger.start(false, "14.微信JSAPI支付金额错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTotal_fee(wxnotifyBean.getTotal_fee() + 1);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_031() {
		Logger.start(false, "15.微信APP支付金额错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTotal_fee(wxnotifyBean.getTotal_fee() + 1);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_032() {
		Logger.start(true, "收单时bizcode1，10支付宝PC支付异步回调校验PostPay100002补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("1");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	@Ignore
	// bizcode2 此业务废弃
	public void Tc_Notify_033() {
		Logger.start(true, "收单时bizcode2，10支付宝PC支付异步回调校验Recharge100003现金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("2");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_034() {
		Logger.start(true, "收单时bizcode3，10支付宝PC支付异步回调校验PayRecharge100001定金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("3");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_035() {
		Logger.start(true, "收单时bizcode4，10支付宝PC支付异步回调校验SellerMarginRecharge100003卖家保证金充值补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("4");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_036() {
		Logger.start(true, "收单时bizcode5，10支付宝PC支付异步回调校验SellerRecharge100003卖家余额充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("5");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_037() {
		Logger.start(true, "收单时bizcode1，13.支付宝-APP支付异步回调校验PostPay100002补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			aqb.setBizCode("1");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	@Ignore
	// bizcode2 此业务废弃
	public void Tc_Notify_038() {
		Logger.start(true, "收单时bizcode2，13.支付宝-APP支付异步回调校验Recharge100003现金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			aqb.setBizCode("2");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_039() {
		Logger.start(true, "收单时bizcode3，13.支付宝-APP支付异步回调校验PayRecharge100001定金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			aqb.setBizCode("3");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_040() {
		Logger.start(true, "收单时bizcode4，13.支付宝-APP支付异步回调校验SellerMarginRecharge100003卖家保证金充值补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			aqb.setBizCode("4");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_041() {
		Logger.start(true, "收单时bizcode5，13.支付宝-APP支付异步回调校验SellerRecharge100003卖家余额充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			aqb.setBizCode("5");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_042() {
		Logger.start(true, "收单时bizcode1，14微信JSAPI支付异步回调校验PostPay100002补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			aqb.setBizCode("1");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	@Ignore
	// bizcode2 此业务废弃
	public void Tc_Notify_043() {
		Logger.start(true, "收单时bizcode2，14微信JSAPI支付异步回调校验Recharge100003现金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			aqb.setBizCode("2");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_044() {
		Logger.start(true, "收单时bizcode3，14微信JSAPI支付异步回调校验PayRecharge100001定金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			aqb.setBizCode("3");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_045() {
		Logger.start(true, "收单时bizcode4，14微信JSAPI支付异步回调校验SellerMarginRecharge100003卖家保证金充值补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			aqb.setBizCode("4");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_046() {
		Logger.start(true, "收单时bizcode5，14微信JSAPI支付异步回调校验SellerRecharge100003卖家余额充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			aqb.setBizCode("5");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_047() {
		Logger.start(true, "收单时bizcode1，15微信APP支付异步回调校验PostPay100002补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			aqb.setBizCode("1");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	@Ignore
	// bizcode2 此业务废弃
	public void Tc_Notify_048() {
		Logger.start(true, "收单时bizcode2，15微信APP支付异步回调校验Recharge100003现金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			aqb.setBizCode("2");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_049() {
		Logger.start(true, "收单时bizcode3，15微信APP支付异步回调校验PayRecharge100001定金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			aqb.setBizCode("3");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_050() {
		Logger.start(true, "收单时bizcode4，15微信APP支付异步回调校验SellerMarginRecharge100003卖家保证金充值补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			aqb.setBizCode("4");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_051() {
		Logger.start(true, "收单时bizcode5，15微信APP支付异步回调校验SellerRecharge100003卖家余额充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			aqb.setBizCode("5");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_052() {
		Logger.start(true, "10支付宝PC输入错误商户号支付异步回调失败JIRACONN-4583");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setSeller_id(alinotifyBean.getSeller_id() + 1);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();

			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_053() {
		Logger.start(true, "11.支付宝WAP支付输入错误商户号异步回调失败JIRACONN-4583");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("11");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("11");
			AliPayWapNotifyBean aliwap = PayGateWayCallService.initAliPayWapNotify(aqb);
			aliwap.setSeller_id(aliwap.getSeller_id() + 1);
			String send = PayGateWayCallService.signAliWapNotify(aliwap);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_054() {
		Logger.start(true, "13.支付宝-APP支付输入错误商户号异步回调失败JIRACONN-4583");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setSeller_id(alinotifyBean.getSeller_id() + 1);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_055() {
		Logger.start(true, "14.微信JSAPI支付输入错误商户号异步回调失败JIRACONN-4583");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("14");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setMch_id(wxnotifyBean.getMch_id() + 1);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_056() {
		Logger.start(true, "15.微信APP支付输入错误商户号异步回调失败JIRACONN-4583");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("15");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setMch_id(wxnotifyBean.getMch_id() + 1);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_057() {
		Logger.start(true, "50招行支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall50 notifyCall50 = new NotifyCall50();
			cmbNotifyBean = PayGateWayCallService.initCMBNotifyBean(aqb, "0");
			String sign = PayGateWayCallService.SignCMBNoticeData(cmbNotifyBean.getNoticeData());
			cmbNotifyBean.setSign(sign);
			String send = PayGateWayCallService.CMBNoticeSendString(cmbNotifyBean);
			// alinotifyBean = initAliPayNotifyBean(aqb);
			// String send = aliPayNotifyBeanToSend(alinotifyBean,aqb);
			notifyCall50.setData(send);
			notifyCall50.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall50.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall50.callService();

			Logger.verifyEquals("success", notifyCall50.getReturnData(), "验证success");
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			verifyDB(aqb, cmbNotifyBean);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				// Logger.verifyEquals(cmbNotifyBean.getBuyer_email(),
				// body.get("externalUserId").toString(), "验证externalUserId");
				// Logger.verifyEquals(cmbNotifyBean.getBuyer_id(),
				// body.get("externalPayerId").toString(), "验证externalPayerId");
				// Logger.verifyEquals(
				// Double.valueOf(cmbNotifyBean.getPrice()),
				// Double.valueOf(body.get("payPrice").toString()),
				// "验证payPrice");
				Logger.verifyEquals(cmbNotifyBean.getNoticeData().getOrderNo(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("CmbPay", body.get("payChannel").toString(), "验证payChannel");

			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_058() {
		Logger.start(true, "50招行支付异步回调成功,有优惠金额");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall50 notifyCall50 = new NotifyCall50();
			cmbNotifyBean = PayGateWayCallService.initCMBNotifyBean(aqb, "1");
			String sign = PayGateWayCallService.SignCMBNoticeData(cmbNotifyBean.getNoticeData());
			cmbNotifyBean.setSign(sign);
			String send = PayGateWayCallService.CMBNoticeSendString(cmbNotifyBean);
			// alinotifyBean = initAliPayNotifyBean(aqb);
			// String send = aliPayNotifyBeanToSend(alinotifyBean,aqb);
			notifyCall50.setData(send);
			notifyCall50.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall50.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall50.callService();

			Logger.verifyEquals("success", notifyCall50.getReturnData(), "验证success");
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			verifyDB(aqb, cmbNotifyBean);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				// Logger.verifyEquals(cmbNotifyBean.getBuyer_email(),
				// body.get("externalUserId").toString(), "验证externalUserId");
				// Logger.verifyEquals(cmbNotifyBean.getBuyer_id(),
				// body.get("externalPayerId").toString(), "验证externalPayerId");
				// Logger.verifyEquals(
				// Double.valueOf(cmbNotifyBean.getPrice()),
				// Double.valueOf(body.get("payPrice").toString()),
				// "验证payPrice");
				Logger.verifyEquals(cmbNotifyBean.getNoticeData().getOrderNo(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("CmbPay", body.get("payChannel").toString(), "验证payChannel");

			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_059() {
		Logger.start(true, "16.微信扫描支付异步回调成功,openid为空");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("16");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("16");
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOpenid(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_060() {
		Logger.start(true, "60ApplePay支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Integer bprice = new BigDecimal(body.get("payPrice").toString()).multiply(new BigDecimal(100)).intValue();
				Logger.verifyEquals(applyPayNotifyBean.getTxnAmt(), bprice, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");

			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_061() {
		Logger.start(false, "60ApplePay回调金额不一致支付异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setSettleAmt(applyPayNotifyBean.getSettleAmt() + 1);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_062() {
		Logger.start(false, "60ApplePay签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			send += 1;
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_063() {
		Logger.start(true, "60ApplePay支付异步回调成功,返回code为A6");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("A6");
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(Double.valueOf(applyPayNotifyBean.getTxnAmt()), Double.valueOf(body.get("payPrice").toString()) * 100, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");

			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_064() {
		Logger.start(false, "60ApplePay回调code非成功,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("12");
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_065() {
		Logger.start(false, "60ApplePay回调订单不存在,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setOrderId(TestDataManager.getRandomUUID().toString());
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_066() {
		Logger.start(true, "70宝付支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("OK", notifyCall70.getReturnData(), "验证success");

			verifyDB(aqb, baofu);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			for (Map mock : mocks) {
				// //{\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Integer bprice = new BigDecimal(body.get("payPrice").toString()).multiply(new BigDecimal(100)).intValue();
				Logger.verifyEquals(baofu.getSucc_amt(), bprice.toString(), "验证payPrice");
				Logger.verifyEquals(baofu.getTrans_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("BaofooPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(baofu.getOrder_id(), body.get("instPaymentId").toString(), "验证instPaymentId");
				// Logger.verifyEquals("MD5", body.get("signMethod").toString(),
				// "验证signMethod");
				//
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_067() {
		Logger.start(false, "70宝付支付金额不一致异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			baofu.setSucc_amt(baofu.getSucc_amt() + 1);
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("failed", notifyCall70.getReturnData(), "验证success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_068() {
		Logger.start(false, "70宝付加密错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			baofu.setSucc_amt(baofu.getSucc_amt());
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=1" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("failed", notifyCall70.getReturnData(), "验证success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_069() {
		Logger.start(false, "70宝付回调code非成功,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			baofu.setResp_code("9999");
			baofu.setResp_msg("未知异常");
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("failed", notifyCall70.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_070() {
		Logger.start(false, "70宝付回调订单不存在,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			baofu.setTrans_id("-111111");
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("failed", notifyCall70.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_071() {
		Logger.start(false, "70宝付回调商户号不匹配,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			baofu.setMember_id("111");
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("failed", notifyCall70.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_072() {
		Logger.start(true, "收单时bizcode15，10支付宝PC支付异步回调校验卖家拼邮溯源保证金支付充值101503_JIRACONN-15218(0921bizcode6改15)");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("15");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_073() {
		Logger.start(true, "10支付宝PC支付RSA加密异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSendPCRSA(alinotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, alinotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(alinotifyBean.getPrice()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(alinotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("Alipay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_074() {
		Logger.start(true, "11.支付宝WAP支付使用RSA加密异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("11");
			aqb.setSignMethod("RSA");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall("11");
			AliPayWapNotifyBean aliwap = PayGateWayCallService.initAliPayWapNotify(aqb);
			String send = PayGateWayCallService.signRSAAliWapNotify(aliwap);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyWapDB(aqb, aliwap);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_075() {
		Logger.start(true, "9.支付宝-花呗支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_076() {
		Logger.start(true, "9.支付宝-花呗支付不输入hb_fq_param失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_077() {
		Logger.start(true, "9.支付宝-花呗新增字段out_channel_type识别是否真正的花呗支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setOut_channel_type("PCREDIT_CC_PCREDIT_INSTALLMENT");
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_078() {
		Logger.start(true, "9.支付宝-花呗新增字段out_channel_type不是花呗修改支付type为13");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setOut_channel_type("BALANCE");
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_079() {
		Logger.start(true, "9.支付宝-花呗新增字段out_channel_type不输入不修改");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setOut_channel_type(null);
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_080() {
		Logger.start(true, "9.支付宝-花呗状态为WAIT_BUYER_PAY不修改type");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setTrade_status("WAIT_BUYER_PAY");
			alinotifyBean.setOut_channel_type(null);
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	//等待支付状态不能修改支付状态
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_081() {
		Logger.start(true, "13.支付宝状态为WAIT_BUYER_PAY时支付状态为Init");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setTrade_status("WAIT_BUYER_PAY");
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_082() {
		Logger.start(true, "收单时bizcode17，10支付宝PC支付异步回调校验-全球买手专项保证金（支付宝付款）");
		try {
			AcquireOrderBean aqb = PaymentProxyCallService.initAcquireOrder("10");
			aqb.setBizCode("17");
			PaymentProxyCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_083() {
		Logger.start(true, "收单时bizcode16，10支付宝PC支付异步回调校验-黑五专项保证金（支付宝付款）");
		try {
			AcquireOrderBean aqb = PaymentProxyCallService.initAcquireOrder("10");
			aqb.setBizCode("16");
			PaymentProxyCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("10");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_084() {
		Logger.start(true, "0.支付宝-MOCK支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("0");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall("0");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_085() {
		Logger.start(true, "17.微信APP小程序支付异步回调成功");
		try {
			AcquireOrderBean aqb = PaymentProxyCallService.initAcquireOrder("17");
			PaymentProxyCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PaymentDefaultWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(wxnotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	private void verifyDB(AcquireOrderBean aqb, ApplePayNotifyBean applyPayNotifyBean) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		Logger.debug("PPPayment:" + FormatUtil.beanToGSONString(ppm));
		if (ppm.getInstitutionPaymentId() == null) {
			Thread.sleep(5000);
			ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
//		Logger.verifyEquals("156", ppm.getActualPayCurrencyType(), "验证ActualPayCurrencyType");
		Logger.verifyEquals(applyPayNotifyBean.getQueryId(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");

		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("卖家保证金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}
	}

	private void verifyDB(AcquireOrderBean aqb, BaoFuNotifyBean baofunbean) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		Logger.debug("PPPayment:" + FormatUtil.beanToGSONString(ppm));
		if (ppm.getInstitutionPaymentId() == null) {
			Thread.sleep(5000);
			ppm =new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
//		Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(), "验证ActualPayCurrencyType");
		// 宝付修改了协议orderid记得是宝付流水 getVoucher_no是第三方流水支付宝
		Logger.verifyEquals(baofunbean.getOrder_id(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
//		Logger.verifyEquals(baofunbean.getVoucher_no(), ppm.getBankId(), "验证BankId-第三方流水支付宝");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("卖家保证金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}
		// Logger.comment("验证PP_CompensateProcessInfo（发货补偿信息）");
		// PPCompensateProcessInfo ppCompensateProcessInfo = new
		// PayGateWayWapper()
		// .selectPPCompensateProcessInfoByCorrelateId(pid).get(0);
		// Logger.verifyEquals("1", ppCompensateProcessInfo.getAppId(),
		// "验证PP_CompensateProcessInfo表中AppId字段为1");
		// Logger.verifyEquals("DeliveryNotify",
		// ppCompensateProcessInfo.getMethodName(),
		// "验证PP_CompensateProcessInfo表中MethodName字段为DeliveryNotify");
		// Logger.verifyEquals(null,
		// ppCompensateProcessInfo.getCompensateType(),
		// "验证PP_CompensateProcessInfo表中CompensateType字段为NULL:支付");
	}

	private void verifyDB(AcquireOrderBean aqb, CMBNotifyBean cmbnotifybean) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		if (ppm.getInstitutionPaymentId() == null) {
			Thread.sleep(5000);
			ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
//		Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(), "验证ActualPayCurrencyType");
		Logger.verifyEquals(cmbnotifybean.getNoticeData().getBankSerialNo(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");

		Logger.verifyEquals(new BigDecimal(cmbnotifybean.getNoticeData().getDiscountAmount()).setScale(2), ppm.getDiscountAmt().setScale(2), "验证DiscountAmt");
		Double app = Double.valueOf(aqb.getPayPrice()) - Double.valueOf(cmbNotifyBean.getNoticeData().getDiscountAmount());
//		Logger.verifyEquals(app, Double.valueOf(ppm.getActualPayPrice().toString()), "验证ActualPayPrice");

		// ?getExchangeRate待确认
//		Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("卖家保证金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}

		// Logger.comment("验证PP_CompensateProcessInfo（发货补偿信息）");
		// PPCompensateProcessInfo ppCompensateProcessInfo = new
		// PayGateWayWapper()
		// .selectPPCompensateProcessInfoByCorrelateId(pid).get(0);
		// Logger.verifyEquals("1", ppCompensateProcessInfo.getAppId(),
		// "验证PP_CompensateProcessInfo表中AppId字段为1");
		// Logger.verifyEquals("DeliveryNotify",
		// ppCompensateProcessInfo.getMethodName(),
		// "验证PP_CompensateProcessInfo表中MethodName字段为DeliveryNotify");
		// Logger.verifyEquals(null,
		// ppCompensateProcessInfo.getCompensateType(),
		// "验证PP_CompensateProcessInfo表中CompensateType字段为NULL:支付");
	}

	// @Test
	// @Category(P2.class)
	// @TestCase
	// @i
	// public void Tc_Notify_052() {
	// Logger.start(true, "使用交易服务生成的订单数据调用13.支付宝-APP支付异步回调成功");
	// try {
	// AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
	// aqb.setOrderId("8629202");
	// aqb.setPayPrice("265");
	// aqb.setUserId("20238699");
	// aqb.setProductName("接口自动化测试Test");
	// notifyCall = new NotifyCall("13");
	// alinotifyBean = initAliPayNotifyBean(aqb);
	// String send = aliPayNotifyBeanToSend(alinotifyBean);
	// notifyCall.setData(send);
	// notifyCall.addHeader("Mock", "1");
	// String mockid = TestDataManager.getRandomUUID().toString();
	// notifyCall.addHeader("MockId", mockid);
	// Logger.comment("添加Mock:" + mockid);
	// notifyCall.callService();
	// Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
	// } catch (Exception e) {
	// Logger.fail(e);
	// }
	// }
	/**
	 * db验证 用于阿里支付
	 * 
	 * @param aqb
	 * @param alinotifyBean1
	 * @throws InterruptedException
	 */
	private void verifyDB(AcquireOrderBean aqb, AliPayNotifyBean alinotifyBean1) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		if (ppm.getInstitutionPaymentId() == null) {
			Thread.sleep(5000);
			 ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}
		// Out_channel_type()==null时不处理 可能是WAIT_BUYER_PAY
		if (aqb.getPayType().equals("9") && alinotifyBean1.getOut_channel_type() == null) {
			Logger.verifyEquals(aqb.getPayType(), ppm.getPayType().toString(), "验证PPPayment的PayType");
		}
		// 判断是否是真正的花呗分期PCREDIT_CC_PCREDIT_INSTALLMENT,不是的话修改type
		else if (aqb.getPayType().equals("9") && (!alinotifyBean1.getOut_channel_type().equals("PCREDIT_CC_PCREDIT_INSTALLMENT"))) {
			Logger.verifyEquals("13", ppm.getPayType().toString(), "验证PPPayment的PayType");
		} else {
			Logger.verifyEquals(aqb.getPayType(), ppm.getPayType().toString(), "验证PPPayment的PayType");
		}
		
		// 支付成功才验证支付状态和资金流水
		if (alinotifyBean1.getTrade_status().equals("TRADE_SUCCESS")) {
			Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
//			Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(), "验证ActualPayCurrencyType");
			Logger.verifyEquals(alinotifyBean1.getTrade_no(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
			// ?getExchangeRate待确认
//			Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
			Logger.verifyEquals(alinotifyBean1.getBuyer_id(), ppm.getPayerId(), "验证PayerId");
			Logger.verifyEquals(alinotifyBean1.getBuyer_email(), ppm.getPayerEmail(), "验证PayerEmail");
			Logger.comment("验证AccountEntry");
			String pid = ppm.getPaymentId();
			Logger.debug("PaymentId:" + pid);
			Map m = new HashMap();
			m.put("bizno", pid);
			AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
			Logger.debug(FormatUtil.beanToGSONString(actinfo));
			Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
			Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
			// 入账 type 2
			Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
			Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
			Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
			Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
			if (aqb.getBizCode().equals("1")) {
				Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:卖家保证金充值");
				Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			} else if (aqb.getBizCode().equals("2")) {
				Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:卖家保证金充值");
				Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			} else if (aqb.getBizCode().equals("3")) {
				Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:卖家保证金充值");
				Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			} else if (aqb.getBizCode().equals("4")) {
				Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("缴纳服务保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:缴纳服务保证金（支付宝付款）");
				Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			} else if (aqb.getBizCode().equals("15")) {
				Logger.verifyEquals("101503", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("缴纳拼邮溯源保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:缴纳拼邮溯源保证金（支付宝付款）");
				Logger.verifyEquals("15", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			}
			else if (aqb.getBizCode().equals("17")) {
				Logger.verifyEquals("101703", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("全球买手专项保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:全球买手专项保证金（支付宝付款）");
				Logger.verifyEquals("17", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			}
			else if (aqb.getBizCode().equals("16")) {
				Logger.verifyEquals("101603", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("黑五专项保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:黑五专项保证金（支付宝付款）");
				Logger.verifyEquals("16", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			}
		}	else if (alinotifyBean1.getTrade_status().equals("WAIT_BUYER_PAY")) {
			Logger.verifyEquals(PayOrderEnum.Init.getValue(), ppm.getPayStatus(), "WAIT_BUYER_PAY时验证PayStatus为Init");
//			Logger.verifyEquals(null, ppm.getActualPayCurrencyType(), "验证ActualPayCurrencyType");
			Logger.verifyEquals(null, ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
			// ?getExchangeRate待确认
//			Logger.verifyEquals(null, ppm.getExchangeRate(), "验证ExchangeRate");
			Logger.verifyEquals(null, ppm.getPayerId(), "验证PayerId");
			Logger.verifyEquals(null, ppm.getPayerEmail(), "验证PayerEmail");
		}

		// Logger.comment("验证PP_CompensateProcessInfo（发货补偿信息）");
		// PPCompensateProcessInfo ppCompensateProcessInfo = new
		// PayGateWayWapper()
		// .selectPPCompensateProcessInfoByCorrelateId(pid).get(0);
		// Logger.verifyEquals("1", ppCompensateProcessInfo.getAppId(),
		// "验证PP_CompensateProcessInfo表中AppId字段为1");
		// Logger.verifyEquals("DeliveryNotify",
		// ppCompensateProcessInfo.getMethodName(),
		// "验证PP_CompensateProcessInfo表中MethodName字段为DeliveryNotify");
		// Logger.verifyEquals(null,
		// ppCompensateProcessInfo.getCompensateType(),
		// "验证PP_CompensateProcessInfo表中CompensateType字段为NULL:支付");
	}

	/**
	 * db验证 用于阿里支付
	 * 
	 * @param aqb
	 * @param alinotifyBean1
	 * @throws InterruptedException
	 */
	private void verifyWapDB(AcquireOrderBean aqb, AliPayWapNotifyBean awb) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		if (ppm.getInstitutionPaymentId() == null) {
			Thread.sleep(5000);
			ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}

		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
//		Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(), "验证ActualPayCurrencyType");
		Logger.verifyEquals(awb.getTrade_no(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
		// ?getExchangeRate待确认
//		Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
		Logger.verifyEquals(awb.getBuyer_id(), ppm.getPayerId(), "验证PayerId");
		Logger.verifyEquals(awb.getBuyer_email(), ppm.getPayerEmail(), "验证PayerEmail");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("卖家保证金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}

		// Logger.comment("验证PP_CompensateProcessInfo（发货补偿信息）");
		// PPCompensateProcessInfo ppCompensateProcessInfo = new
		// PayGateWayWapper()
		// .selectPPCompensateProcessInfoByCorrelateId(pid).get(0);
		// Logger.verifyEquals("1", ppCompensateProcessInfo.getAppId(),
		// "验证PP_CompensateProcessInfo表中AppId字段为1");
		// Logger.verifyEquals("DeliveryNotify",
		// ppCompensateProcessInfo.getMethodName(),
		// "验证PP_CompensateProcessInfo表中MethodName字段为DeliveryNotify");
		// Logger.verifyEquals(null,
		// ppCompensateProcessInfo.getCompensateType(),
		// "验证PP_CompensateProcessInfo表中CompensateType字段为NULL:支付");
	}

	/**
	 * db验证 用于微信支付
	 * 
	 * @param aqb
	 * @param alinotifyBean1
	 * @throws InterruptedException
	 */
	private void verifyDB(AcquireOrderBean aqb, WeiXinNotifyBean wxnotifbean) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
//		Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(), "验证ActualPayCurrencyType");
		Logger.verifyEquals(wxnotifbean.getTransaction_id(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
		// ?getExchangeRate待确认
//		Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
		Logger.verifyEquals(wxnotifbean.getOpenid(), ppm.getPayerId(), "验证PayerId");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Logger.verifyEquals(pid, wxnotifbean.getOut_trade_no(), "验证weixinbean.Out_trade_no为PaymentId");
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("缴纳服务保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:缴纳服务保证金（支付宝付款）");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}

		// Logger.comment("验证PP_CompensateProcessInfo（发货补偿信息）");
		// PPCompensateProcessInfo ppCompensateProcessInfo = new
		// PayGateWayWapper()
		// .selectPPCompensateProcessInfoByCorrelateId(pid).get(0);
		// Logger.verifyEquals("1", ppCompensateProcessInfo.getAppId(),
		// "验证PP_CompensateProcessInfo表中AppId字段为1");
		// Logger.verifyEquals("DeliveryNotify",
		// ppCompensateProcessInfo.getMethodName(),
		// "验证PP_CompensateProcessInfo表中MethodName字段为DeliveryNotify");
		// Logger.verifyEquals(null,
		// ppCompensateProcessInfo.getCompensateType(),
		// "验证PP_CompensateProcessInfo表中CompensateType字段为NULL:支付");

	}

	/**
	 * AliPayNotifyBean加签并转换为SendString
	 * 
	 * @param alipaybean
	 * @param aqb
	 * @return
	 * @throws Exception
	 */
	private String aliPayNotifyBeanToSend(AliPayNotifyBean alipaybean, AcquireOrderBean aqb) throws Exception {
		Logger.comment("AliPayNotifyBean加签并转换为SendString");
		String send = null;
		if (aqb.getPayType().equals("13")) {
			// 排序加签名
			String src = FormatUtil.beanToHttpString(alinotifyBean, false);
			String sign = new Sign().SignSHA1WithRSA(src);
			alinotifyBean.setSign(sign);
			alinotifyBean.setSign_type("RSA");
			// 转换成最终发出的数据
			send = FormatUtil.beanToHttpString(alinotifyBean, true);
		} else {
			String src = FormatUtil.beanToHttpString(alinotifyBean, false);
			String sign = new Sign().signMd5(alinotifyBean, Sign.autoTestKey);
			alinotifyBean.setSign(sign);
			alinotifyBean.setSign_type("MD5");
			send = FormatUtil.beanToHttpString(alinotifyBean, true);
		}
		return send;
	}

	private String aliPayNotifyBeanToSendPCRSA(AliPayNotifyBean alipaybean) throws Exception {
		Logger.comment("AliPayNotifyBean加签并转换为SendString");
		String send = null;
		// 排序加签名
		String src = FormatUtil.beanToHttpString(alinotifyBean, false);
		String sign = new Sign().SignSHA1WithRSA(src);
		alinotifyBean.setSign(sign);
		alinotifyBean.setSign_type("RSA");
		// 转换成最终发出的数据
		send = FormatUtil.beanToHttpString(alinotifyBean, true);
		return send;
	}

	private String aliPayNotifyBeanToSendWAPRSA(AliPayNotifyBean alipaybean) throws Exception {
		Logger.comment("AliPayNotifyBean加签并转换为SendString");
		String send = null;
		// 排序加签名
		String src = FormatUtil.beanToHttpString(alinotifyBean, false);
		String sign = new Sign().SignSHA1WithRSA(src);
		alinotifyBean.setSign(sign);
		alinotifyBean.setSign_type("RSA");
		// 转换成最终发出的数据
		send = FormatUtil.beanToHttpString(alinotifyBean, true);
		return send;
	}

	/**
	 * AliPayNotifyBean加签并转换为SendString
	 * 
	 * @param alipaybean
	 * @param aqb
	 * @return
	 * @throws Exception
	 */
	private String applyPayNotifyBeanToSend(ApplePayNotifyBean applyPayNotifyBean, AcquireOrderBean aqb) throws Exception {
		Logger.comment("ApplePayNotifyBean加签并转换为SendString");
		String plaintext = FormatUtil.beanToHttpString(applyPayNotifyBean, false);
		byte[] signDigest = SecurityUtil.sha1(plaintext, ApplePayConstants.encoding);
		signDigest = Hex.toHexBytes(signDigest, ApplePayConstants.encoding);
		PrivateKey privateKey = RSAUtils.loadPrivateKey(EnvSetup.getData("privateK"));
		byte[] signData = SecurityUtil.signWithSha1Rsa(privateKey, signDigest);
		signData = Base64.getEncoder().encode(signData);
		applyPayNotifyBean.setSignature(new String(signData));
		String send = FormatUtil.beanToHttpString(applyPayNotifyBean, true);
		return send;
	}

	/**
	 * WeiXinNotifyBean加签并转换为SendString
	 * 
	 * @param weixinbean
	 * @return
	 * @throws Exception
	 */
	public static String weiXinNotifyBeanToSend(WeiXinNotifyBean weixinbean) throws Exception {
		Logger.comment("WeiXinNotifyBean加签并转换为SendString");
		// 排序加签名
		// String src = FormatUtil.beanToHttpString(weixinbean, false);
		// String sign = SignSHA1WithRSA(src);

		String sign = new Sign().signMd5(weixinbean, "&key=" + Sign.autoTestKey);
		weixinbean.setSign(sign);

		// 转换成最终发出的数据
		String send = FormatUtil.beanToXmlString(weixinbean);
		return send;
	}

	/**
	 * 初始化 AliPayNotifyBean
	 * 
	 * @param aqb
	 * @return
	 * @throws InterruptedException
	 */
	private ApplePayNotifyBean initApplePayNotifyBean(AcquireOrderBean aqb) throws InterruptedException {
		// trandno 是PaymentId
		// PPBussinessorder ppb = new
		// PayGateWayWapper().selectPPBussinessorderByTraceId(aqb.getTraceId()).get(0);
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		Integer price = new BigDecimal(aqb.getPayPrice()).multiply(new BigDecimal(100)).intValue();

		applyPayNotifyBean.setBizType("000201");// 000201
		applyPayNotifyBean.setOrderId(trandno);// 17050410190438490

		applyPayNotifyBean.setTraceNo(TestDataManager.getRandomUUID().toString().replaceAll("-", ""));// 78591936

		applyPayNotifyBean.setSettleAmt(price);// 101

		applyPayNotifyBean.setSettleCurrencyCode("156");// 156
		applyPayNotifyBean.setTxnType("01");// 01+

		applyPayNotifyBean.setQueryId(TestDataManager.getRandomUUID().toString().replaceAll("-", ""));// 78591936

		applyPayNotifyBean.setAccessType("0");// 0
		applyPayNotifyBean.setTxnTime(YMTDateUtil.getSysTime("yyyyMMddHHmmss"));// 20170504101911
		applyPayNotifyBean.setPayCardType("01");// 01
		applyPayNotifyBean.setTxnSubType("01");// 01
		applyPayNotifyBean.setEncoding("UTF-8");// UTF-8
		applyPayNotifyBean.setVersion("5.0.0");// 5.0.0
		applyPayNotifyBean.setRespMsg("paysuccess");// paysuccess
		applyPayNotifyBean.setMerId(PayGateWayCallService.APPLEPAY_MERID);// 308310053994237
		applyPayNotifyBean.setCurrencyCode("156");// 156
		applyPayNotifyBean.setRespCode("00");// 00
		applyPayNotifyBean.setSignMethod("01");// 01

		applyPayNotifyBean.setTxnAmt(price);// 101
		return applyPayNotifyBean;
	}

	/**
	 * 初始化 AliPayNotifyBean
	 * 
	 * @param aqb
	 * @return
	 * @throws InterruptedException
	 */
	private AliPayNotifyBean initAliPayNotifyBean(AcquireOrderBean aqb) throws InterruptedException {
		alinotifyBean.setBody("自动化测试订单");
		alinotifyBean.setBusiness_scene("qrpay");
		alinotifyBean.setBuyer_email(TestDataManager.getEmail());
		alinotifyBean.setBuyer_id("2088" + TestDataManager.getRandomNum(10));
		alinotifyBean.setDiscount("0");
		alinotifyBean.setExtra_common_param("自动化测试回传参数");
		alinotifyBean.setGmt_close(YMTDateUtil.getBeforeOrNextDay(1));
		alinotifyBean.setGmt_create(YMTDateUtil.getBeforeOrNextSecond(1));
		alinotifyBean.setGmt_payment(YMTDateUtil.getBeforeOrNextSecond(2));
		alinotifyBean.setGmt_refund(null);
		alinotifyBean.setIs_total_fee_adjust("N");
		alinotifyBean.setNotify_id(TestDataManager.getClientpaymentId());
		alinotifyBean.setNotify_time(YMTDateUtil.getBeforeOrNextSecond(3));
		alinotifyBean.setNotify_type("trade_status_sync");
		// trandno 是PaymentId
		// PPBussinessorder ppb = new
		// PayGateWayWapper().selectPPBussinessorderByTraceId(aqb.getTraceId()).get(0);
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		alinotifyBean.setOut_trade_no(trandno);
		alinotifyBean.setPayment_type("1");
		alinotifyBean.setPrice(aqb.getPayPrice());
		alinotifyBean.setQuantity("1");
		alinotifyBean.setRefund_status(null);
		alinotifyBean.setSeller_email("ap.ymt@ymatou.com");
		alinotifyBean.setSeller_id("2088701734809577");
		alinotifyBean.setSubject(aqb.getProductName());
		alinotifyBean.setTotal_fee(aqb.getPayPrice());
		alinotifyBean.setTrade_no(TestDataManager.getRandomUUID().toString());
		alinotifyBean.setTrade_status("TRADE_SUCCESS");
		alinotifyBean.setUse_coupon("N");
		return alinotifyBean;
	}

	/**
	 * 初始化 AliPayNotifyBean
	 * 
	 * @param aqb
	 * @return
	 * @throws InterruptedException
	 */
	private WeiXinNotifyBean initWeixinBean(AcquireOrderBean aqb) throws InterruptedException {
		// <xml><appid><![CDATA[wxf51a439c0416f182]]></appid>
		// <bank_type><![CDATA[CMB_DEBIT]]></bank_type>
		// <cash_fee><![CDATA[8200]]></cash_fee>
		// <fee_type><![CDATA[CNY]]></fee_type>
		// <is_subscribe><![CDATA[N]]></is_subscribe>
		// <mch_id><![CDATA[1234079001]]></mch_id>
		// <nonce_str><![CDATA[b82bbe0b28954973ad2a9c98618af516]]></nonce_str>
		// <openid><![CDATA[oASzYjrBI-LG8JMNSIC3c5VSynGU]]></openid>
		// <out_trade_no><![CDATA[20160412172258588000000000023844]]></out_trade_no>
		// <result_code><![CDATA[SUCCESS]]></result_code>
		// <return_code><![CDATA[SUCCESS]]></return_code>
		// <sign><![CDATA[E39042D497F3952F55F17D310B58EC36]]></sign>
		// <time_end><![CDATA[20160412172307]]></time_end>
		// <total_fee>8200</total_fee>
		// <trade_type><![CDATA[APP]]></trade_type>
		// <transaction_id><![CDATA[4009562001201604124771601467]]></transaction_id>
		// </xml>
		wxnotifyBean.setAppid("wxf51a439c0416f182");
		if(aqb.getPayType().equals("17")){
			wxnotifyBean.setAppid(PaymentProxyCallService.WX_AppID);
		}
		wxnotifyBean.setAttach(TestDataManager.getRandomUUID().toString());
		wxnotifyBean.setBank_type(BankIdEnum.CMB.name());
		Double payprice = Double.valueOf(aqb.getPayPrice());
		int iprice = (int) (payprice * 100);
		Logger.debug("iprice:" + iprice);
		wxnotifyBean.setCash_fee(String.valueOf(iprice));
		wxnotifyBean.setCash_fee_type(null);
		wxnotifyBean.setCoupon_count("0");
		wxnotifyBean.setCoupon_fee("0");
		wxnotifyBean.setDevice_info(TestDataManager.getRandomUUID().toString());
		wxnotifyBean.setErr_code(null);
		wxnotifyBean.setErr_code_des(null);
		wxnotifyBean.setFee_type("CNY");
		wxnotifyBean.setIs_subscribe("N");
		if (aqb.getPayType().equals("14") || aqb.getPayType().equals("16")|| aqb.getPayType().equals("17")) {
			wxnotifyBean.setMch_id("1278350701");
		} else {
			wxnotifyBean.setMch_id("1234079001");
		}
		wxnotifyBean.setNonce_str(TestDataManager.getRandomUUID().toString().replace("-", "").substring(0, 31));
		// Map m = new DefaultWapper().selectLastWeixinUser();
		ThirdpartyUserbind tu = new JUserWapper().selectWXUser();
		String uid = tu.getUserId().toString();
		wxnotifyBean.setOpenid(tu.getOpenId());
		// trandno 是PaymentId
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		wxnotifyBean.setOut_trade_no(trandno);
		wxnotifyBean.setResult_code("SUCCESS");
		wxnotifyBean.setTime_end(YMTDateUtil.getSysTime("yyyyMMddHHmmss"));
		wxnotifyBean.setTotal_fee(String.valueOf(iprice));
		if (aqb.getPayType().equals("14")) {
			wxnotifyBean.setTrade_type("JSAPI");
		} else if (aqb.getPayType().equals("15")) {
			wxnotifyBean.setTrade_type("APP");
		} else {
			wxnotifyBean.setTrade_type("NATIVE");
		}
		wxnotifyBean.setTransaction_id(TestDataManager.getRandomUUID().toString().replace("-", "").substring(0, 31));
		wxnotifyBean.setReturn_code("SUCCESS");
		wxnotifyBean.setReturn_msg("成功");
		return wxnotifyBean;
	}

	/**
	 * 对源数据SignSHA1WithRSA加签
	 * 
	 * @param src
	 *            源数据
	 * @return
	 * @throws Exception
	 */
	private String SignSHA1WithRSA(String src) throws Exception {
		PrivateKey privateKey = RSAUtils.loadPrivateKey(EnvSetup.getData("privateK"));
		TreeMap tm = new TreeMap();
		tm.putAll((FormatUtil.httpStringToMap(src)));
		String fromatS = FormatUtil.mapToHttpString(tm, true);
		String signSWR = RSAUtils.SignSHA1WithRSA(fromatS, privateKey);
		return signSWR;
	}
}
